<!DOCTYPE html>
<html>
<head>
<title>提现管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<#include "../../../../include/resources.html">
<script type="text/javascript">
	$.canEdit = false;
</script>
<script type="text/javascript">
	$.canDelete = false;
</script>
<script type="text/javascript">
	$.canAdd = false;
</script>
<script type="text/javascript">
	$.canGrant = false;
</script>
<script type="text/javascript">
	var dataGrid;
	var winWidth =  800;
	var winHeight = 280;
	
	var kfVerifyTitle="客服提现审核";
	var kfVerifyUrl="/modules/account/cash/accountcash/kfVerifyCashEditPage.html";
	var kfVerifyWinParmeters = "'{0}','"+kfVerifyTitle+"',800,500,'"+kfVerifyUrl+"','确定'";

	var reNotifyTitle="队列重新触发";
	var reNotifyTitleUrl="/modules/account/cash/accountcash/reNotify.html";
	var val1 = 1;

	$(function() {
		dataGrid = $('#dataGrid').datagrid({
			url : 'verifyAccountCashList.html',
			fit : true,
			fitColumns : true,
			border : false,
			pagination : true,
			idField : 'id',
			pageSize : pageSize,
			pageNums :1,
			pageList : pageList,
			sortName : 'id',
			sortOrder : 'desc',
			checkOnSelect : false,
			selectOnCheck : false,
			nowrap : false,
			singleSelect:true,
			frozenColumns:[[
			{ field: 'id', title: '编号', width: 50,fixed: true,sortable:true},
			{ field: 'orderNo', title: '订单号', width: 170},
			{ field: 'userName', title: '用户名', width: 80},
			{ field: 'realName', title: '真实姓名', width: 80}
			]],
			columns : [[ 			
			{ field: 'status', title: '状态', width: 100,formatter:function(value, row, index){
					switch(value){
					case 0:return "申请提现";
					case 1:return "提现成功";
					case 2:return "提现失败";
					case 4:return "新浪提现申请中";
					}
				}
			},
			{ field: 'bankNo', title: '银行账号', width: 170},
			{ field: 'bank', title: '所属银行', width: 80},
			{ field: 'money', title: '提现总额(元)', width: 90,formatter:function(value, row, index){
				return value;
			}},
			{ field: 'amount', title: '到账金额(元)', width: 90,formatter:function(value, row, index){
				return value;
			}},
			{ field: 'fee', title: '手续费(元)', width: 80,formatter:function(value, row, index){
				return value;
			}},
			{ field: 'feeBear', title: '承担方', width: 80,
				formatter: function(value,row,index){
					if (value == 1){
						return "平台垫付";
					} else if (value == 2){
						return "个人支付";
					}
				}
			},
			{ field: 'addTime', title: '提现时间', width: 150,
				formatter: function(value,row,index){
					if (value){
						return getLocalTime(value,4);
					} else {
						return "";
					}
				}
			},
			
			{ field : 'showInfo',
                title : '其他信息',
                width :75,
                align:'center',
                fixed:true,
                formatter : function(value, row, index) {
                	var mark = row.verifyRemark;
                	if(mark == "undefined" || mark == null || mark == ""){
                		mark = '-';
                	}
					var content = '<a href="javascript:void(0);" class="j-showInfo">查看<i class="iconfont">&#xe639;</i></a>'
						+ '<div class="showInfoSingleDiv">'
						+ '<div class="showInfo">'
						+ '<em></em><h2>提现信息</h2>'
						+ '<ul>'
						
						+ '<li>'
                		+ '<span>审核备注：</span>'
						+ mark
						+ '</li>'
						+ '</ul></div></div>';
				return content;
				}
			},
			
			{field : 'action',title : '操作',width :60,fixed: true,formatter : function(value, row, index) {
					var str = '';
					if (row.status==0) {//客服提现审核
						str += $.formatString('<img onclick="$.fn.dataGridOptions.editFun('+kfVerifyWinParmeters+');" src="{1}" title="客服提现审核"/>', row.id, '${theme_dir}/css/images/extjs_icons/key.png');
					}
			    	if(row.status==4){
					str += '<a href="javascript:void(0);" onclick="$.fn.dataGridOptions.recordOptFun('+row.id+',reNotifyTitleUrl,reNotifyTitle,val1);">重新触发</a>';
			 	}
					return str;
				}
			} 
			 ]],
			onRowContextMenu : function(e, rowIndex, rowData) {
				e.preventDefault();
				$(this).datagrid('unselectAll').datagrid('uncheckAll');
				$(this).datagrid('selectRow', rowIndex);
				$('#menu').menu('show', {
					left : e.pageX,
					top : e.pageY
				});
			}
		});
	});

	function exportExcel(){
		var url = "/modules/account/cash/accountcash/exportExcelAccountCash.html";
		var orderNo = $("orderNo").val;
		var userName = $("#userName").val();
		var realName = $("#realName").val();
		var status = $("#status").val();
		var startTime = $("#startTime").val();
		var endTime = $("#endTime").val();
		var sou = "?userName=" + userName + "&realName=" + realName + "&status=" + status + "&startTime=" + startTime + "&endTime=" + endTime + "&orderNo=" + orderNo;
		window.location.href = url + sou;
	}
</script>
</head>
<body style="padding:0 20px;" >
	<div class="easyui-layout" data-options="fit : true,border : false">
		<div data-options="region:'north',border:false,collapsible:false" id="searchBox">
        	<div class="sLeft">
	            <form id="searchForm">
	            	<input type="text"  name="searchName" class="sInput" placeholder="输入用户名/真实姓名进行搜索" autocomplete="off" onkeydown="if(event.keyCode == 13){ $.fn.dataGridOptions.searchFun('#searchForm');return false;}"/><a href="javascript:;" title="查询" class="sBtn" onclick="$.fn.dataGridOptions.searchFun('#searchForm');">查询</a><a href="javascript:;" class="advBtn" title="条件查询">条件查询 <i class="iconfont">&#xe638;</i></a>
	            	<a href="javascript:void(0);" class="reloadIcon" onclick="dataGrid.datagrid('reload');" title="刷新" ><i class="iconfont">&#xe603;</i></a>
	            </form>
            </div>
            <div class="sRight">
            	<a id="a" onclick="exportExcel();" href="javascript:void(0);" class="addBtn">导出excel</a>	
            </div>
            <form id="showAdw">
		        <ul class="showAdw" style="display:none;">
		        	<a href="javascript:void(0);"><i class="iconfont closeWin">&#xe628;</i></a>
					<li><span>订单号</span><input type="text" name="orderNo" id="orderNo"/></li>
		        	<li><span>用户名</span><input type="text" name="userName" autocomplete="off" id="userName"/></li>
		        	<li><span>真实姓名</span><input type="text" name="realName" autocomplete="off" id="realName"/></li>
		       		<li><span>状态</span><select name="status" id="status" class="type">
		       				<option value="99" selected="selected">全部</option>
							<!--<option value="0" selected="selected">申请提现</option>-->
							<option value="1">提现成功</option>
							<option value="2">提现失败</option>
							<option value="4">新浪提现申请中</option>
						</select></li>
					<li><span>手续费承担方</span><select name="feeBear"  class="type">
						<option value="99" selected="selected">全部</option>
						<option value="1">平台垫付</option>
						<option value="2">个人支付</option>
						</select></li>
		       		<li><span>时间</span><input type="text" name="startTime" id="startTime" onFocus="WdatePicker({maxDate:'#F{$dp.$D(\'endTime\')}',readOnly:true})" class="searchTime"/>&nbsp;-&nbsp;<input type="text" name="endTime" id="endTime" onFocus="WdatePicker({minDate:'#F{$dp.$D(\'startTime\')}',readOnly:true})" class="searchTime"/></li>
		       		<li><span>&nbsp;</span><a href="javascript:void(0);" class="searchBtn sureBtn" onclick="$.fn.dataGridOptions.searchFun('#showAdw');">确定</a><a href="javascript:void(0);" class="searchBtn" onclick="$.fn.dataGridOptions.cleanFun('#searchForm');">重置</a></li>
		        </ul>
	        </form>
		</div>
		<div data-options="region:'center'" style="margin-top:30px;padding-bottom:30px;">
			<table id="dataGrid"></table>
		</div>
	</div>
</body>
</html>
<script src="${theme_dir}/js/search.js"></script>